<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorate="~{layout/simple}">
<head>
	<title>个人中心</title>
</head>
<body>
<th:block layout:fragment="page-content">
	<!-- <div class="avtivity-scroll bg-orange">
		<span class="scroll">活动公告：凡是在2017年10月24日充值，充5送5，充10送10，充100送100，机会仅此当天，不容错过哟~</span>
	</div> -->
	<div class="weui_cells ">
		<a class="weui_cell" href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>头像</p>
			</div>
			<div class="weui_cell_ft">
				<img class="weui-avatar" th:src="'https://i.caisan.net/api/avatar/'+${member.mid}+'/50'">
			</div>
		</a> 
		<a class="weui_cell" href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>昵称</p>
			</div>
			<div class="weui_cell_ft">[(${member.displayName})]</div>
		</a>
	</div>
	
	<div class="weui_cells">
		<a class="weui_cell " href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>手机号码</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.mobile} == null ? '暂无' : ${member.mobile})]
			</div>
		</a> 
		<a class="weui_cell no_access" href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>邮箱</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.email} == null ? '暂无' : ${member.email})]
			</div>
		</a>
		<a id="btn-weixin" class="weui_cell weui_cells_access" href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>微信</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.openid} == null ? '未绑定' : '已绑定')]
			</div>
		</a>
	</div>
	
	<div class="weui_cells">
		<a class="weui_cell weui_cells_access" th:href="@{/pay/index}">
			<div class="weui_cell_bd weui_cell_primary">
				<p>彩豆</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.caidou})] 颗
			</div>
		</a> 
		<a class="weui_cell " href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>积分</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.credit})] 分
			</div>
		</a>
		<a class="weui_cell " href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>等级</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.level})] 级
			</div>
		</a>
		<a class="weui_cell " href="javascript:;">
			<div class="weui_cell_bd weui_cell_primary">
				<p>经验</p>
			</div>
			<div class="weui_cell_ft">
				[(${member.exp})] EXP
			</div>
		</a>
	</div>
</th:block>
<th:block layout:fragment="page-js">
	<script type="text/javascript">
		$(function(){
			$('#btn-weixin').click(function(){
				$.confirm("您确定要解除绑定吗?", "解除绑定", function() {
					$.ajax({
						type: 'post',
						url: contextPath + '/user/unbind',
						dataType: 'json',
						beforeSend: function(){
							$.showLoading('正在处理');
						},
						success: function(result){
							$.hideLoading();
							if(result.success){
								location.href = contextPath + "/wechat/success?msg=已解除微信绑定";
							} else {
								$.toptips(result.message);
							}
						}
					});
		        }, function() {
		        	//$.toast("取消操作", "cancel");
		        });
			});
		});
	</script>
</th:block>
</body>
</html>
